import request from '@/utils/request'
/**
 * 获取简单角色列表
 * @returns
 */
export function getEmployeesList() {
  return request({
    url: '/sys/user/simple'
  })
}
/**
 * 获取完整员工列表
 * @param {*} params {page, size}
 * @returns
 */
export function getAllEmployeesList(params) {
  return request({
    url: '/sys/user',
    params
  })
}

/**
 * 新增员工
 * @param {*} data
 * @returns
 */
export const addEmployees = (data) => {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}

export const importEmployees = data => {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}
/**
 * 获取员工信息
 * @param {*} data
 * @returns
 */
export const getEmployeesInfo = id => {
  return request({
    url: `/employees/${id}/jobs`
  })
}

export const saveEmployeesInfo = data => {
  return request({
    url: `/employees/${data.id}/jobs`,
    method: 'put',
    data
  })
}
